home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Imaging / RealShapes / PolyShpe.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.8 KB  |  100 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        PolyShpe.h
  3.  
  4.     Contains:    PolygonShape class, private to ODShape.
  5.  
  6.     Written by:    Jens Alfke
  7.  
  8.     Copyright:    1993-94 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <4>     12/5/94    jpa        Code review cleanup [1203923]. Also
  13.                                     simplify before clipping [1196018]
  14.          <3>    10/24/94    jpa        Added fSimple flag [1191192]
  15.          <2>      8/8/94    jpa        Added Outset method [1178690]
  16.          <1>     6/15/94    jpa        first checked in
  17.                             --------Moved to SOM project and rearranged-----
  18.          <7>      5/9/94    jpa        Enable polygon clipper and GX support
  19.                                     [1162090]
  20.          <6>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  21.                                     #1150864.
  22.          <5>     2/17/94    JA        Declare XMPPolygon as struct, not class.
  23.          <4>     2/16/94    JA        Include new AltPoint.h.
  24.          <3>     2/10/94    JA        Stop using ptrs to member fns.
  25.          <2>      2/9/94    JA        Renamed from ShapePrv.h --> ShapePvM.h
  26.          <6>      2/7/94    JA        Further tigerings.
  27.          <5>      2/3/94    JA        Tiger Team Makeover!
  28.          <4>     1/31/94    JA        XMPRealShape no longer derives from
  29.                                     XMPAbsShape. Other API improvements.
  30.          <3>    11/24/93    VL        Rolled back changes as ASLM build breaks
  31.                                     the THINK build.
  32.          <2>    11/23/93    VL        Made this work with ASLM.
  33.          <1>    11/23/93    JA        first checked in
  34.  
  35.     In Progress:
  36. */
  37.  
  38.  
  39. #ifndef _POLYSHPE_
  40. #define _POLYSHPE_
  41.  
  42. #ifndef _ODTYPES_
  43. #include "ODTypes.h"
  44. #endif
  45.  
  46. #ifndef _PLFMDEF_
  47. #include "PlfmDef.h"
  48. #endif
  49.  
  50. #ifndef _REALSHPE_
  51. #include "RealShpe.h"        /* Base class*/
  52. #endif
  53.  
  54.  
  55. //==============================================================================
  56. // PolyShape
  57. //==============================================================================
  58.  
  59.  
  60. class PolygonShape :public RealShape {
  61.     public:
  62.     PolygonShape( ODGeometryMode );
  63.     virtual ~PolygonShape( );
  64.  
  65.     ODVMethod ODSize        Purge( ODSize );
  66.     
  67.     ODVMethod void            GetBoundingBox( ODRect *bounds );
  68.     ODVMethod RealShape*    SetRectangle( const ODRect *rect );
  69.     ODVMethod void            CopyPolygon( ODPolygon& );
  70.     ODVMethod RealShape*    SetPolygon( const ODPolygon& );
  71.     ODVMethod void            Simplify( );            // Call after SetPolygon if poly isn't simple
  72.  
  73.     ODVMethod ODBoolean        IsSameAs( RealShape* compareShape );
  74.     ODVMethod ODBoolean        IsEmpty( );
  75.     ODVMethod ODBoolean        ContainsPoint(ODPoint point);
  76.     ODVMethod ODBoolean        IsRectangular( );
  77.     
  78.     ODVMethod RealShape*    Copy( );    // Really returns an ODPolygonShape*
  79.  
  80.     ODVMethod RealShape*    Transform( Environment*, ODTransform* );
  81.     ODVMethod RealShape*    Outset(ODCoordinate distance);
  82.     ODVMethod RealShape*    Subtract(RealShape* diffShape);
  83.     ODVMethod RealShape*    Intersect(RealShape* sectShape);
  84.     ODVMethod RealShape*    Union(RealShape* sectShape);
  85.     
  86.     ODVMethod RealShape*    Combine( ODShapeOp, RealShape* );
  87.  
  88.     protected:
  89.     ODVMethod void            InitQDRegion( );
  90.     ODVMethod gxShape        CopyGXShape( );
  91.  
  92.     private:
  93.             
  94.     ODPolygon    fPolygon;
  95.     ODRect        fBounds;
  96.     ODBoolean    fBoundsValid;
  97. };
  98.  
  99.  
  100. #endif /*_POLYSHPE_*/